//
//  AppDelegate.swift
//  微博
//
//  Created by 段瑞金 on 16/5/10.
//  Copyright © 2016年 段瑞金. All rights reserved.
//

import UIKit
import AFNetworking

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

        // 0.设置AFN属性
        let cache = NSURLCache(memoryCapacity: 4 * 1024 * 1024, diskCapacity: 20 * 1024 * 1024, diskPath: nil)
        
        NSURLCache.setSharedURLCache(cache)
        
        AFNetworkActivityIndicatorManager.sharedManager().enabled = true
        

        //设置主题颜色
        UITabBar.appearance().tintColor = UIColor.orangeColor()
        UIBarButtonItem.appearance().tintColor = UIColor.orangeColor()
        //创建窗口
        window = UIWindow(frame: UIScreen.mainScreen().bounds)
        window?.rootViewController = MainTabBarViewController()
        window?.makeKeyAndVisible()
        

        
        return true
    }



}

//自定义log
func RJLOG<T>(message : T , file : String = #file , method : String = #function , line : Int = #line) ->()
{
    #if RJ_DEBUG
    let fileName = (file as NSString).pathComponents.last!
    print("在\(fileName)文件的\(method)方法中-[第\(line)行]-打印的这个信息:\(message)")
    #endif
}

